﻿@model IEnumerable<Forest.Lion.Model.Deal>
@{
    ViewBag.Title = "业务积分";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div id="wrap">
    <div class="wrapContents">
        <h1>
            业务积分</h1>
        <div class="search">
            <div class="search_left">
            </div>
            <div class="search_right">
            </div>
            <div class="cr">
            </div>
        </div>
        <table cellpadding="0" cellspacing="0" width="100%">
            <thead>
                <tr>
                    <th>
                        编号
                    </th>
                    <th>
                        业务内容
                    </th>
                    <th>
                        收入
                    </th>
                    <th>
                        支出
                    </th>
                    <th>
                        交易日期
                    </th>
                    <th>
                        状态
                    </th>
                    <th>
                        备注
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var deal in Model) {
                    <tr>
                        <td align="left">
                            <b style="color: #12799a">@deal.DealNumber</b>
                        </td>
                        <td align="left">@deal.DealSummary
                        </td>
                        <td align="left">
                            @if (deal.Direction == 1) {
                                <b>@String.Format("{0:N0}", deal.Points) </b>
                            }
                        </td>
                        <td>
                            @if (deal.Direction == -1) {
                                <b style="color: red">@String.Format("{0:N0}", deal.Points) </b>     
                            }
                        </td>
                        <td align="left">@String.Format("{0:yyyy/MM/dd}", deal.DealOn)
                        </td>
                        <td align="left">
                            @{
                            if (deal.ExpiresOn != null) {

                                if (DateTime.Compare((DateTime)deal.ExpiresOn, DateTime.Now.Date) >= 0) { 
                                @Html.Raw("可用") }
                                else {  <b style="color: red">失效</b>
                                }
                            }
                            }
                        </td>
                        <td align="left">
                            @deal.Remark
                        </td>
                    </tr>
       
                }
            </tbody>
        </table>
        <div class="pagelists">
        </div>
    </div>
</div>
